-
Notifications
You must be signed in to change notification settings - Fork 76
feat: InMemoryCatalog::CreateTable & StageCreateTable api #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
b83be34 to
805973f
Compare
a399aee to
9190a30
Compare
src/iceberg/table_metadata.h
Outdated
| int64_t next_row_id; | ||
|
|
||
| static Result<std::unique_ptr<TableMetadata>> Make( | ||
| const iceberg::Schema& schema, const iceberg::PartitionSpec& spec, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should rename functions below to GetSchema, GetSnapshot, etc. so we don't need to write iceberg:: prefix here and elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Rename the function name like
GetSchema. - use
classkeyword replace of the namespace specified, likeconst class Schema& schema, const class PartitionSpec& spec.
There's no need to write the namespaceicebergprefix other than TableMetadata's class scope. So I don't think rename function is well, we'll writeGetSchemaeverywhere. I prefer solution 2.
src/iceberg/table_metadata.cc
Outdated
| } | ||
|
|
||
| // Reassign all column ids to ensure consistency | ||
| std::atomic<int32_t> last_column_id = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to use atomic here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, It's convert from java, I think it's not really needed, fix it.
src/iceberg/table_metadata.cc
Outdated
| constexpr std::string_view kMetadataFolderName = "metadata"; | ||
|
|
||
| // TableMetadata private static methods | ||
| Result<std::shared_ptr<PartitionSpec>> FreshPartitionSpec( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think FreshPartitionSpec and FreshSortOrder should also be called in the SetDefaultPartitionSpec and SetDefaultSortOrder, respectively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike Java impl, I think no need to fresh field id in the TableMetadataBuilder::AddXXX.
No description provided.